const { defineConfig } = require('@vue/cli-service')
const { WEB_TITLE, IPADDR } = require("./application")
module.exports = defineConfig({
  productionSourceMap: false, // 生成关闭map
  transpileDependencies: true,
  lintOnSave: false,
  devServer: {
    proxy: {
      '/api': {
        target: IPADDR,
        ws: true,
        changeOrigin: true
      },
    },
  },
  chainWebpack: config => {
    config
      .plugin('html')
      .tap(args => {
        args[0].title = WEB_TITLE
        return args
      })

    config.module
      .rule('md')
      .test(/\.md$/)
      .use('html-loader')
      .loader('html-loader')
      .end()
      .use('markdown-loader')
      .loader('markdown-loader')
      .end()
  },
})
